#include<iostream>
using namespace std;
int main(){
	int a[]={1,3,2,4,6,5,8,7,9};
	int i,sum,ave;
	for(i=0;i<8;i++)
	 {  
	    int j;
	 	if(a[i]<a[i+1]){
	 	    j=a[i+1];
	 	    a[i+1]=a[i];
	 	    a[i]=j;
		}
	 }
	 a[8]=0;
	 for(i=0;i<8;i++)
	 {  
	    int j;
	 	if(a[i]>a[i+1]){
	 	    j=a[i+1];
	 	    a[i+1]=a[i];
	 	    a[i]=j;
		}
	 }
	 a[8]=0;
	 for(i=0;i<8;i++)
	    sum+=a[i];
	 ave=sum/7;
	 cout<<ave;
	 return 0;
} 
